// write your code here
import java.util.*;
public class TestDemo1{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        while(sc.hasNextInt()){
            int n = sc.nextLine();
            String[] str = new String[n];
            for(int i = 0; i < n;i++){
                str[i] = sc.nextLine();
            }
            StringBuilder sb = new StringBuilder();
            for(String s:str){
                if(s.contains(",")){
                    sb.append("\"");
                    sb.append(s);
                    sb.append("\"");
                }else{
                    sb.append(s);
                }
                sb.append(",");
            }
            System.out.println(sb.toString().substring(0,sb.length()-1));
        }
    }
}